public class Student {

    private String name;
    private int age;
    private String studentId;
    private double gpa;
    private String major;

    // 定义构造方法
    public Student(String name, int age, String studentId, double gpa, String major) {
        this.name = name;
        this.age = age;
        this.studentId = studentId;
        this.gpa = gpa;
        this.major = major;
    }

    // 定义学生类方法
    public void introduce() {
        System.out.println("My name is " + name + ", I am " + age + " years old, and my major is " + major + ".");
    }

    public void displayGpa() {
        System.out.println("My GPA is: " + gpa);
    }
}


